home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1989 …il & Dave's Excellent CD / Excellent CD HFS.raw / Moof / Goodies / MPW Goodies / Interfaces / AIncludes / QuickEqu.a < prev    next >
Encoding:
Text File  |  1988-11-30  |  15.3 KB  |  471 lines  |  [TEXT/MPS ]

  1. ; Version: 1.02
  2. ; Created: Tuesday, August 2, 1988 at 9:45:56 PM
  3. ;
  4. ; File: QuickEqu.a
  5. ;
  6. ; Assembler Interface to the Macintosh Libraries
  7. ; Copyright Apple Computer, Inc. 1984-1988
  8. ; All Rights Reserved
  9. ;
  10. ;___________________________________________________________________________
  11. ;
  12. ; QuickDraw Equates -- This file defines the public equates for QuickDraw.
  13. ; This is divided into two pieces for assembly space and speed
  14. ; considerations. The wholeQuick flag is used to include the less
  15. ; common equates which realizes a complete set.
  16. ;___________________________________________________________________________
  17.  
  18.  
  19. ; IF (&TYPE('wholeQuick') = 'UNDEFINED') THEN
  20.  
  21. ; ENDIF
  22.  
  23.  
  24. ; Transfer modes
  25.  
  26. srcCopy         EQU         0
  27. srcOr            EQU         1
  28. srcXor            EQU         2
  29. srcBic            EQU         3
  30. notSrcCopy        EQU         4
  31. notSrcOr        EQU         5
  32. notSrcXor        EQU         6
  33. notSrcBic        EQU         7
  34. patCopy         EQU         8
  35. patOr            EQU         9
  36. patXor            EQU         10
  37. patBic            EQU         11
  38. notPatCopy        EQU         12
  39. notPatOr        EQU         13
  40. notPatXor        EQU         14
  41. notPatBic        EQU         15
  42.  
  43. ; Arithmetic transfer modes
  44. blend            EQU         32
  45. addPin            EQU         33
  46. addOver         EQU         34
  47. subPin            EQU         35
  48. adMax            EQU         37
  49. subOver         EQU         38
  50. adMin            EQU         39
  51.  
  52. ; Definitions for Font Style Bits (right to left)
  53.  
  54. boldBit         EQU         0
  55.  
  56. ; Transparent mode constant
  57. transparent     EQU         36
  58. italicBit        EQU         1
  59. ulineBit        EQU         2
  60. outlineBit        EQU         3
  61. shadowBit        EQU         4
  62. condenseBit     EQU         5
  63. extendBit        EQU         6
  64.  
  65.  
  66. ; FontInfo record
  67.  
  68. ascent            EQU         0                        ; ascent [word]
  69. descent         EQU         2                        ; descent [word]
  70. widMax            EQU         4                        ; maximum width [word]
  71. leading         EQU         6                        ; leading [word]
  72.  
  73. ; Rectangle structure
  74.  
  75. topLeft         EQU         0                        ; upper left corner [point]
  76. botRight        EQU         4                        ; lower right corner [point]
  77. top             EQU         0                        ; top coordinate [word]
  78. left            EQU         2                        ; left coordinate [word]
  79. bottom            EQU         4                        ; bottom coordinate [word]
  80. right            EQU         6                        ; right coordinate [word]
  81.  
  82. ; Bitmap Structure
  83.  
  84. baseAddr        EQU         0                        ; bitmap base address [pointer]
  85. rowBytes        EQU         4                        ; row bytes (must be even) [word]
  86. bounds            EQU         6                        ; bounding box [rectangle]
  87. bitmapRec        EQU         14                        ; size of a bitmap
  88.  
  89. ; Cursor Structure
  90.  
  91. data            EQU         0                        ; visible bits [32 bytes]
  92. mask            EQU         $20                     ; mask bits [32 bytes]
  93. hotSpot         EQU         $40                     ; relative origin [point]
  94. cursRec         EQU         68                        ; size of a cursor
  95.  
  96. ; PenState record
  97.  
  98. psLoc            EQU         0                        ; pen location [point]
  99. psSize            EQU         4                        ; pen size [point]
  100. psMode            EQU         8                        ; pen mode [word]
  101. psPat            EQU         10                        ; pen [pattern]
  102. psRec            EQU         18                        ; size of pen state
  103.  
  104. ; Polygon record
  105.  
  106. polySize        EQU         0                        ; total bytes [word]
  107. polyBBox        EQU         2                        ; bounding box [rectangle]
  108. polyPoints        EQU         10                        ; vertices [Points]
  109.  
  110. ; Region Structure
  111.  
  112. rgnSize         EQU         0                        ; total bytes [word]
  113. rgnBBox         EQU         2                        ; bounding box [rectangle]
  114. rgnData         EQU         10                        ; region data [array]
  115.  
  116. ; Picture Structure
  117.  
  118. picSize         EQU         0                        ; total bytes [word]
  119. picFrame        EQU         2                        ; bounding box [rectangle]
  120. picData         EQU         10                        ; picture byte codes [array]
  121.  
  122. ; QDProcs structure
  123.  
  124. textProc        EQU         0                        ; [pointer]
  125. lineProc        EQU         4                        ; [pointer]
  126. rectProc        EQU         8                        ; [pointer]
  127. rRectProc        EQU         $C                        ; [pointer]
  128. ovalProc        EQU         $10                     ; [pointer]
  129. arcProc         EQU         $14                     ; [pointer]
  130. polyProc        EQU         $18                     ; [pointer]
  131. rgnProc         EQU         $1C                     ; [pointer]
  132. bitsProc        EQU         $20                     ; [pointer]
  133. commentProc     EQU         $24                     ; [pointer]
  134. txMeasProc        EQU         $28                     ; [pointer]
  135. getPicProc        EQU         $2C                     ; [pointer]
  136. putPicProc        EQU         $30                     ; [pointer]
  137. qdProcsRec        EQU         $34                     ; size of QDProcs record
  138.  
  139. ; GrafPort Structure
  140.  
  141. device            EQU         $0                        ; device code [word]
  142. portBits        EQU         $2                        ; port's bitmap [bitmap]
  143. portBounds        EQU         $8                        ; bounding box of bitmap [rect]
  144. portRect        EQU         $10                     ; port's rectangle [rect]
  145. visRgn            EQU         $18                     ; visible region [handle]
  146. clipRgn         EQU         $1C                     ; clipping region [handle]
  147.  
  148.  
  149. ; color manager equates
  150.  
  151. ; RGBColor structure
  152.  
  153. red             EQU         $0                        ;red channel intensity [short]
  154. green            EQU         $2                        ;green channel intensity[short]
  155. blue            EQU         $4                        ;blue channel intensity [short]
  156. rgbColor        EQU         $6                        ;size of record
  157.  
  158. ; ColorSpec structure
  159.  
  160. value            EQU         $0                        ;value field [short]
  161. rgb             EQU         $2                        ;rgb values [rgbColor]
  162. colorSpecSize    EQU         $8                        ;size of record
  163.  
  164. ; MatchRec structure
  165.  
  166. ;red EQU $0 ;defined in RGBColor
  167. ;green EQU $2 ;defined in RGBColor
  168. ;blue EQU $4 ;defined in RGBColor
  169. matchData        EQU         $6                        ; [long]
  170. matchRecSize    EQU         $A
  171. bkPat            EQU         $20                     ; background [pattern]
  172. fillPat         EQU         $28                     ; fill [pattern]
  173. pnLoc            EQU         $30                     ; pen location [point]
  174. pnSize            EQU         $34                     ; pen size [point]
  175. pnMode            EQU         $38                     ; pen mode [word]
  176. pnPat            EQU         $3A                     ; pen [pattern]
  177. pnVis            EQU         $42                     ; pen visible [word]
  178. txFont            EQU         $44                     ; text font [word]
  179. txFace            EQU         $46                     ; text face [word]
  180. txMode            EQU         $48                     ; text mode [word]
  181. txSize            EQU         $4A                     ; text size [word]
  182. spExtra         EQU         $4C                     ; space extra [fixed]
  183. fgColor         EQU         $50                     ; foreground color mask [long]
  184. bkColor         EQU         $54                     ; background color mask [long]
  185. colrBit         EQU         $58                     ; color bit [word]
  186. patStretch        EQU         $5A                     ; pattern stretch [word]
  187. picSave         EQU         $5C                     ; picture being saved [handle]
  188. rgnSave         EQU         $60                     ; region being saved [handle]
  189. polySave        EQU         $64                     ; polygon being saved [handle]
  190. grafProcs        EQU         $68                     ; QDProcs array [pointer]
  191. portRec         EQU         $6C                     ; size of grafport
  192.  
  193.  
  194. ; QuickDraw Global Variables
  195.  
  196.  
  197. GrafGlobals     EQU         0                        ; A5 offset to globptr
  198. thePort         EQU         0                        ;GrafPtr
  199. white            EQU         thePort-8                ;Pattern
  200. black            EQU         white-8                 ;Pattern
  201. gray            EQU         black-8                 ;Pattern
  202. ltGray            EQU         gray-8                    ;Pattern
  203. dkGray            EQU         ltGray-8                ;Pattern
  204. arrow            EQU         dkGray-68                ;Cursor
  205. screenBits        EQU         arrow-14                ;BitMap
  206. randSeed        EQU         screenBits-4            ;LONGINT
  207.  
  208.  
  209. ; IF wholeQuick=1 THEN
  210.  
  211. ; Color Separation
  212.  
  213. normalBit        EQU         0                        ; normal screen mapping
  214. inverseBit        EQU         1                        ; inverse screen mapping
  215. redBit            EQU         4                        ; RGB additive mapping
  216. greenBit        EQU         3                        ; for photos from screen
  217. blueBit         EQU         2
  218. cyanBit         EQU         8                        ; CMYBk subtractive mapping
  219. yellowBit        EQU         6
  220. magentaBit        EQU         7                        ; for ink jet printer
  221. blackBit        EQU         5
  222. blackColor        EQU         33
  223. whiteColor        EQU         30
  224. redColor        EQU         205
  225. greenColor        EQU         341
  226. blueColor        EQU         409
  227. cyanColor        EQU         273
  228. magentaColor    EQU         137
  229. yellowColor     EQU         69
  230.  
  231.  
  232. ; Standard Picture Comments
  233.  
  234. picLParen        EQU         0
  235. picRParen        EQU         1
  236.  
  237. ; QuickDraw verbs
  238.  
  239. frame            EQU         0
  240. paint            EQU         1
  241. erase            EQU         2
  242. invert            EQU         3
  243. fill            EQU         4
  244.  
  245. ; QuickDraw private global variables
  246.  
  247. wideOpen        EQU         randSeed-4                ;RgnHandle
  248. wideMaster        EQU         wideOpen-4                ;RgnPtr
  249. wideData        EQU         wideMaster-10            ;Fake Region
  250. rgnBuf            EQU         wideData-4                ;PointsHandle
  251. rgnIndex        EQU         rgnBuf-2                ;INTEGER
  252. rgnMax            EQU         rgnIndex-2                ;INTEGER
  253. playPic         EQU         rgnMax-4                ;Long
  254. qdSpare0        EQU         playPic-2                ;unused word
  255. thePoly         EQU         qdSpare0-4                ;POLYHANDLE
  256. polyMax         EQU         thePoly-2                ;INTEGER
  257. patAlign        EQU         polyMax-4                ;Point
  258. fontAdj         EQU         patAlign-4                ;Fixed Point
  259. fontPtr         EQU         fontAdj-4                ;long, ^FMOutput record
  260. playIndex        EQU         fontPtr-4                ;long
  261. fontData        EQU         playIndex-22            ;unused word
  262. lastGrafGlob    EQU         fontData
  263. grafSize        EQU         4-lastGrafGlob            ;total size in bytes
  264.  
  265.  
  266. ;************** FROM HERE TO THE ENDIF IS ALL THE NEW STUFF FOR COLOR QUICKDRAW *************
  267.  
  268. hiliteBit        EQU         7                        ; flag bit in HiliteMode (lowMem flag)
  269.  
  270. ; Equates for resource ID's
  271.  
  272. defQDColors     EQU         127                     ; resource ID of clut for default QDColors
  273.  
  274. ;
  275. ; PixMap field offsets
  276.  
  277. pmBaseAddr        EQU         $0                        ; [long]
  278. pmNewFlag        EQU         $4                        ; [1 bit] upper bit of rowbytes is flag
  279. pmRowBytes        EQU         $4                        ; [word]
  280. pmBounds        EQU         $6                        ; [rect]
  281. pmVersion        EQU         $E                        ; [word] pixMap version number
  282. pmPackType        EQU         $10                     ; [word] defines packing format
  283. pmPackSize        EQU         $12                     ; [long] size of pixel data
  284. pmHRes            EQU         $16                     ; [fixed] h. resolution (ppi)
  285. pmVRes            EQU         $1A                     ; [fixed] v. resolution (ppi)
  286. pmPixelType     EQU         $1E                     ; [word] defines pixel type
  287. pmPixelSize     EQU         $20                     ; [word] # bits in pixel
  288. pmCmpCount        EQU         $22                     ; [word] # components in pixel
  289. pmCmpSize        EQU         $24                     ; [word] # bits per field
  290. pmPlaneBytes    EQU         $26                     ; [long] offset to next plane
  291. pmTable         EQU         $2A                     ; [long] color map
  292. pmReserved        EQU         $2E                     ; [long] MUST BE 0
  293. pmRec            EQU         $32                     ; size of pixMap record
  294.  
  295. ; PixPat field offsets
  296. ;
  297.  
  298. patType         EQU         $0                        ; [word] type of pattern
  299. patMap            EQU         $2                        ; [long] handle to pixmap
  300. patData         EQU         $6                        ; [long] handle to data
  301. patXData        EQU         $A                        ; [long] handle to expanded pattern data
  302. patXValid        EQU         $E                        ; [word] flags whether expanded pattern valid
  303. patXMap         EQU         $10                     ; [long] handle to expanded pattern data
  304. pat1Data        EQU         $14                     ; [8 bytes] old-style pattern/RGB color
  305. ppRec            EQU         $1C                     ; size of pixPat record
  306.  
  307.  
  308. ; Pattern types
  309. ;
  310.  
  311. oldPat            EQU         0                        ; foreground/background pattern
  312. newPat            EQU         1                        ; self-contained color pattern
  313. ditherPat        EQU         2                        ; rgb value to be dithered
  314. oldCrsrPat        EQU         $8000                    ; old-style cursor
  315. cCrsrPat        EQU         $8001                    ; new-style cursor
  316.  
  317.  
  318. ; additional offsets in a color GrafPort
  319. ;
  320.  
  321. portPixMap        EQU         portBits                ; [long] pixelMap handle
  322. portVersion     EQU         portPixMap+4            ; [word] port version number
  323. grafVars        EQU         portVersion+2            ; [long] handle to more fields
  324. chExtra         EQU         grafVars+4                ; [word] character extra
  325. pnLocHFrac        EQU         chExtra+2                ; [word] pen fraction
  326. bkPixPat        EQU         bkPat                    ; [long] handle to bk pattern
  327. rgbFgColor        EQU         bkPixPat+4                ; [6 bytes] RGB components of fg color
  328. rgbBkColor        EQU         rgbFgColor+6            ; [6 bytes] RGB components of bk color
  329. pnPixPat        EQU         $3A                     ; [long] handle to pen's pattern
  330. fillPixPat        EQU         pnPixPat+4                ; [long] handle to fill pattern 
  331.  
  332.  
  333. ; GDevice field offsets
  334. ;
  335.  
  336. gdRefNum        EQU         $0                        ; [word] unitNum of driver
  337. gdID            EQU         $2                        ; [word] client ID for search procs
  338. gdType            EQU         $4                        ; [word] fixed/CLUT/direct
  339. gdITable        EQU         $6                        ; [long] handle to inverse table
  340. gdResPref        EQU         $A                        ; [word] preferred resolution for inverse tables
  341. gdSearchProc    EQU         $C                        ; [long] search proc (list?) pointer
  342. gdCompProc        EQU         $10                     ; [long] complement proc (list?) pointer
  343. gdFlags         EQU         $14                     ; [word] grafDevice flags word
  344. gdPMap            EQU         $16                     ; [long] handle to pixMap describing device
  345. gdRefCon        EQU         $1A                     ; [long] reference value
  346. gdNextGD        EQU         $1E                     ; [long] handle of next gDevice
  347. gdRect            EQU         $22                     ; [rect] device's bounds in global coordinates
  348. gdMode            EQU         $2A                     ; [long] device's current mode
  349. gdCCBytes        EQU         $2E                     ; [word] depth of expanded cursor data
  350. gdCCDepth        EQU         $30                     ; [word] depth of expanded cursor data
  351. gdCCXData        EQU         $32                     ; [long] handle to cursor's expanded data
  352. gdCCXMask        EQU         $36                     ; [long] handle to cursor's expanded mask
  353. gdReserved        EQU         $3A                     ; [long] MUST BE 0
  354. gdRec            EQU         $3E                     ; size of GrafDevice record
  355.  
  356. ; VALUES FOR GDType
  357.  
  358. clutType        EQU         0                        ; 0 if lookup table
  359. fixedType        EQU         1                        ; 1 if fixed table
  360. directType        EQU         2                        ; 2 if direct values
  361.  
  362. ; BIT ASSIGNMENTS FOR GDFlags
  363.  
  364. gdDevType        EQU         0                        ; 0 = monochrome; 1 = color
  365. ramInit         EQU         10                        ; 1 if initialized from 'scrn' resource
  366. mainScreen        EQU         11                        ; 1 if main screen
  367. allInit         EQU         12                        ; 1 if all devices initialized
  368. screenDevice    EQU         13                        ; 1 if screen device [not used]
  369. noDriver        EQU         14                        ; 1 if no driver for this GDevice
  370. screenActive    EQU         15                        ; 1 if in use
  371.  
  372. ; CCrsr (Color Cursor) field offsets
  373. ;
  374. ; NOTE THAT THE FIRST FOUR FIELDS ARE PARALLEL TO THE FIRST FOUR FIELDS
  375. ; OF A PATTERN SO THAT PATCONVERT CAN BE USED TO EXPAND A CURSOR
  376. ;
  377.  
  378. crsrType        EQU         0                        ;[WORD] CURSOR TYPE
  379. crsrMap         EQU         crsrType+2                ;[LONG] HANDLE TO CURSOR'S PIXMAP
  380. crsrData        EQU         crsrMap+4                ;[LONG] HANDLE TO CURSOR'S COLOR DATA
  381. crsrXData        EQU         crsrData+4                ;[LONG] HANDLE TO EXPANDED DATA
  382. crsrXValid        EQU         crsrXData+4             ;[WORD] DEPTH OF EXPANDED DATA (0 IF NONE)
  383. crsrXHandle     EQU         crsrXValid+2            ;[LONG] HANDLE FOR FUTURE USE
  384. crsr1Data        EQU         crsrXHandle+4            ;[16 WORDS] ONE-BIT DATA
  385. crsrMask        EQU         crsr1Data+32            ;[16 WORDS] ONE-BIT MASK
  386. crsrHotSpot     EQU         crsrMask+32             ;[POINT] HOT-SPOT FOR CURSOR
  387. crsrXTable        EQU         crsrHotSpot+4            ;[LONG] TABLE ID FOR EXPANDED DATA
  388. crsrID            EQU         crsrXTable+4            ;[LONG] ID FOR CURSOR
  389. crsrRec         EQU         crsrID+4                ;SIZE OF CURSOR SAVE AREA
  390.  
  391.  
  392. ; CIcon (Color Icon) field offsets
  393. ;
  394.  
  395. iconPMap        EQU         0                        ;[PIXMAP] ICON'S PIXMAP
  396. iconMask        EQU         iconPMap+pmRec            ;[BITMAP] 1-BIT VERSION OF ICON ONE-BIT MASK FOR ICON
  397. iconBMap        EQU         iconMask+bitmapRec        ;[BITMAP] 1-BIT VERSION OF ICON
  398. iconData        EQU         iconBMap+bitmapRec        ;[LONG] HANDLE TO PIXMAP DATA
  399. ;FOLLOWED BY BMAP AND MASK DATA
  400. iconRec         EQU         iconData+4                ;SIZE OF ICON HEADER
  401.  
  402. ;
  403. ; Gamma Table format
  404. ;
  405. gVersion        EQU         0                        ; [word] gamma version number
  406. gType            EQU         gVersion+2                ; [word] gamma data type
  407. gFormulaSize    EQU         gType+2                 ; [word] Formula data size
  408. gChanCnt        EQU         gFormulaSize+2            ; [word] number of channels of data
  409. gDataCnt        EQU         gChanCnt+2                ; [word] number of values/channel
  410. gDataWidth        EQU         gDataCnt+2                ; [word] bits/corrected value (data packed to next larger byte size)
  411. gFormulaData    EQU         gDataWidth+2            ; [array] data for formulas, followed by gamma values
  412.  
  413.  
  414. ; EXTENSIONS TO THE QDPROCS RECORD
  415. ;
  416.  
  417. opcodeProc        EQU         $34                     ; [pointer]
  418. newProc1        EQU         $38                     ; [pointer]
  419. newProc2        EQU         $3C                     ; [pointer]
  420. newProc3        EQU         $40                     ; [pointer]
  421. newProc4        EQU         $44                     ; [pointer]
  422. newProc5        EQU         $48                     ; [pointer]
  423. newProc6        EQU         $4C                     ; [pointer]
  424. cqdProcsRec     EQU         $50                     ; size of QDProcs record
  425.  
  426. ; OFFSETS WITHIN GRAFVARS:
  427. ;
  428. rgbOpColor        EQU         0                        ; [6 bytes] color for addPin, subPin and average
  429. rgbHiliteColor    EQU         rgbOpColor+6            ; [6 bytes] color for hiliting
  430. pmFgColor        EQU         rgbHiliteColor+6        ; [4 bytes] palette handle for foreground color
  431. pmFgIndex        EQU         pmFgColor+4             ; [2 bytes] index value for foreground
  432. pmBkColor        EQU         pmFgIndex+2             ; [4 bytes] palette handle for background color
  433. pmBkIndex        EQU         pmBkColor+4             ; [2 bytes] index value for background
  434. pmFlags         EQU         pmBkIndex+2             ; [2 bytes] flags for Palette Manager
  435. grafVarRec        EQU         pmFlags+2                ; size of grafVar record
  436.  
  437. ; ColorTable field offsets
  438.  
  439. ctSeed            EQU         0                        ; [long] id number for table
  440. ctFlags            EQU         ctSeed+4                ; [word] high bit: 0 = PixMap; 1 = device
  441. ctSize            EQU         ctFlags+2                ; [word] number of entries in CTTable
  442. ctTable         EQU         ctSize+2                ; [variant] array of color spec
  443. ctRec            EQU         ctTable                 ; size of record without color table
  444. ctEntrySize     EQU         8                        ; size of each entry in table
  445. minSeed         EQU         1023                    ; minimum seed value (< minSeed reserved for rsrc ID's)
  446. protectBit        EQU         7                        ; protect bit in device color table
  447. reserveBit        EQU         6                        ; reserve bit in device color table
  448. invalColReq     EQU         -1                        ; invalid color table request
  449.  
  450. ; CProcRec structure
  451.  
  452. nxtComp         EQU         $0                        ;link to next proc [pointer]
  453. compProc        EQU         $4                        ;pointer to routine [pointer]
  454. cProcSize        EQU         8                        ; size of CProcRec
  455. ; SProcRec structure
  456.  
  457. nxtSrch         EQU         $0                        ;[pointer] link to next proc
  458. srchproc        EQU         $4                        ;[pointer] pointer to routine
  459. sProcSize        EQU         8                        ; size of SProcRec
  460.  
  461. ; request List structure
  462.  
  463. reqLSize        EQU         0                        ; request list size [word]
  464. reqLData        EQU         2                        ; request list data [words]
  465.  
  466.  
  467. ; Point structure
  468.  
  469. v                EQU         0                        ; vertical coordinate [word]
  470. h                EQU         2                        ; horizontal coordinate [word]
  471.